/*
 * $Header: $
 * $Id$
 *
 * Copyright (c) 2011, Michael DePhillips. All Rights Reserved.
 * This code may not be used without the express written permission
 * of the copyright holder, Michael DePhillips.
 */
package com.facebook.bannermaker.android;

import com.facebook.bannermaker.android.util.AppConstants;
import com.google.android.apps.analytics.GoogleAnalyticsTracker;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;

/**
 * Activity for reading help information
 *
 * @author Michael DePhillips
 * 
 */
public class HelpActivity extends Activity {

   // private static final String LOG_TAG = HelpActivity.class.getName();
    GoogleAnalyticsTracker tracker;
    //Inner class reference

    @Override
    public void onCreate(Bundle savedInstanceState) {
        
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.help_menu);     

        tracker = GoogleAnalyticsTracker.getInstance();

        // Start the tracker in manual dispatch mode...
        tracker.startNewSession(AppConstants.GOOGLE_ANALYTICS_CODE, this);
        
    	// register the user clicked the button
        tracker.trackEvent(
        		"Button",  // Category
                "Click",  // Action
                "Help", // Label
                17);       // Value              

        tracker.dispatch();
        
        // default key strokes all go to searching
        setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
    }
    
    @Override
    protected void onDestroy() {
      super.onDestroy();
      // Stop the tracker when it is no longer needed.
      tracker.stopSession();
    }
    
    /**
     * Return to login screen
     */
    public void helpMenuOkayClick(View v) {
        finish();
    }
}